﻿@using ThirdPrize.Classes
@using ThirdPrize.Models;

@model StoriesModel

@{
    ViewBag.Title = "Stories";
}

<body>
    <h1>@Model.Tag</h1>
    @if (Model.Stories != null)
    {
        string lastDate = String.Format("{0:d}", DateTime.MaxValue);
        foreach (Story r in Model.Stories)
        {
            string newDate = String.Format("{0:d}", r.PublishDate);
            if (newDate != lastDate)
            {
        <p>
            <h3>@newDate</h3>
        </p>
                lastDate = newDate;
            }
        <p>

            <img src="@r.IconUrl" width="16" height="16"/><a href="@r.Uri">    @r.Title</a> <em>@String.Join(" ", r.Tags)</em>
        </p>
        }
    }
    <div>
        <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
        <!-- NewsAds -->
        <ins class="adsbygoogle"
            style="display: inline-block; width: 728px; height: 90px"
            data-ad-client="ca-pub-0574130303791064"
            data-ad-slot="9195966857"></ins>
        <script>
            (adsbygoogle = window.adsbygoogle || []).push({});
        </script>

    </div>

</body>
